﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="PhotoDetails.aspx.vb" Inherits="LFC_photosharing.PhotoDetails" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="ajx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>This photo was TAG by</h2><br />
<!--change the name of tag prefix to make bulletedlist work -->
    <asp:BulletedList ID="BulletedList1" runat="server" 
        DataSourceID="SqlDataSource2" DataTextField="TagName" DataValueField="TagName">
    </asp:BulletedList>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:KOPConn %>" 
        ProviderName="<%$ ConnectionStrings:KOPConn.ProviderName %>" 
        SelectCommand="SELECT DISTINCT [ID], [TagName] FROM [TagView] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>

    <br />
    Tag Seperated by Space<br />
    <asp:TextBox ID="tb_NewTag" runat="server" Width="326px"></asp:TextBox>
    <br />
    <asp:CheckBoxList ID="CheckBoxList1" runat="server" 
        DataSourceID="SqlDataSource1" DataTextField="TagName" DataValueField="ID" 
        RepeatDirection="Horizontal">
    </asp:CheckBoxList>
    <asp:Button ID="btn_Select" runat="server" Text="Select" />
    <br />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:KOPConn %>" 
        ProviderName="<%$ ConnectionStrings:KOPConn.ProviderName %>" 
        SelectCommand="SELECT DISTINCT [TagName], [ID] FROM [Tag] ORDER BY [TagName]">
    </asp:SqlDataSource>

    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:KOPConn %>" 
        ProviderName="<%$ ConnectionStrings:KOPConn.ProviderName %>" 
        SelectCommand="SELECT [ID], [PhotoName], [Author], [Picture], [UploadDate] FROM [Photolist] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <asp:Button ID="btn_Like" runat="server" Text="Like?" />
    <asp:Button ID="btn_Dislike" runat="server" Text="Dislike?" />
    <asp:Label ID="lb_Liked" runat="server" BackColor="#6699FF" BorderColor="Blue" 
        BorderStyle="Dashed" Font-Bold="True" Font-Italic="True" Font-Size="Larger" 
        Font-Strikeout="False" ForeColor="Red" Text="You Like It.!!"></asp:Label>

<asp:DataList BorderWidth="2" BorderStyle="Solid" ID="DataList2" width="500" runat="server" DataSourceID="SqlDataSource3">
        <ItemTemplate>
            <h2>Photo:&nbsp;<asp:Label ID="Label1" runat="server" Text='<%# Eval("PhotoName") %>'></asp:Label>&nbsp;By
            <asp:Label ID="Label2" runat="server" Text='<%# Eval("Author") %>'></asp:Label>
            </h2>
            UploadDate:
            <asp:Label ID="Label3" runat="server" Text='<%# Eval("UploadDate")%>'></asp:Label>
            <br />
            <asp:Image ID="Image2" runat="server" 
                ImageUrl='<%# Eval("Picture") %>' />
        </ItemTemplate>
    </asp:DataList>

<p><asp:Label ID="Lb_Comments" 
        runat="server" Text="Comments" BackColor="#66FFFF" BorderColor="Red" 
        BorderStyle="Groove" BorderWidth="2px" Font-Bold="True" Font-Italic="True" 
        Font-Names="Arial" Font-Overline="False" Font-Size="Large" 
        Font-Strikeout="False" Font-Underline="False" ForeColor="Black"></asp:Label>
    </p>

    <div style="overflow: auto; height:300px;border:2px solid #969696;">
    <asp:datalist  ID="DataList1"  Width="100%"   runat="server" DataSourceID="CommentDB">
     
       
    <ItemTemplate>    
        <div style="border:1px solid #969696;">
        <asp:HyperLink style="font-size:medium; color:Blue" ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("UserName","Profile.aspx?TravellerName={0}") %>'>
        <asp:Image src='<%# Eval("Picture") %>' ID="Image1" runat="server"  Height="100px" Width="100px" /> 
        <%# Eval("UserName")%></asp:HyperLink></div>
        <div style="border:1px solid #969696;">
        <div class="commenttitle">Subject:&nbsp;<%# Eval("Subject")%></div>
        <div class="commentcontent">
        Message:&nbsp;<%# Eval("Message")%></div>
        <div class="commenttitle" style="text-align:right;"><%# Eval("AddDate")%></div></div>
    </ItemTemplate>
    </asp:datalist>
    </div>

    <ajx:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </ajx:ToolkitScriptManager>
    <br />

    


    <asp:SqlDataSource ID="CommentDB" runat="server" 
        ConnectionString="<%$ ConnectionStrings:KOPConn %>" 
        ProviderName="<%$ ConnectionStrings:KOPConn.ProviderName %>" 
        
        
        
        SelectCommand="SELECT [Userfkid], [Picture], [Subject], [Photofkid], [Message], [AddDate], [UserName] FROM [CommentView] WHERE ([Photofkid] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="Photofkid" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>

<div style="border:2px solid #969696;">Please rate this photo.his photo.<br />

    <ajx:Rating BorderWidth="1" BorderStyle="Solid" width="200" Height="40" ID="Rating1" runat="server" StarCssClass="ratingStar" 
    WaitingStarCssClass="savedRatingStar" 
    EmptyStarCssClass="emptyRatingStar" 
    filledStarCssClass="filledRatingStar">
    </ajx:Rating>

    <asp:Button ID="btn_Rating" runat="server" Text="Rate!!" Width="120px" />
    <br />
    <br />
    Any Comment for this photo,
    <asp:LoginName ID="LoginName1" runat="server" />
    ?<br />
    <br />
    Title<br />
    <asp:TextBox ID="tb_Subject" runat="server"></asp:TextBox>
    <br />
    <br />
    Your Comment<br />
    <asp:TextBox ID="tb_Message" runat="server" Height="100px" Width="400px" 
        TextMode="MultiLine"></asp:TextBox>
    <br />
    <br />
    <asp:Button ID="btn_Submit" runat="server" Text="Submit" Width="139px" /></div>

</asp:Content>
